//
//  lnddNetworkTools.swift
//  liaoningdangdai
//
//  Created by 邵禹曦 on 2019/11/22.
//  Copyright © 2019 白雨桐. All rights reserved.
//

import UIKit


// MARK: - 直供提货模块
extension NetworkTools {
    
    
    /// 可交收申请
    /// 2.1
    /// 加载数据字典数组
    ///
    /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
    /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
    /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
    
    func issue_enable_delivery_query(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
           
        if session_id == nil {
            print("请登陆")
            return
        }
        
        // 1.获取请求的URLString
           let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
           
           // 2.获取请求的参数
        let parameters = ["method" : "phone", "xmlname" : "issue_enable_delivery_query","model":"直供提货手机端","data": code ] as [String : Any]
           
           // 3.发送网络请求
        request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
            finished(result as? [String : AnyObject], error as NSError?)
           }
       }
    
    
    
    /// 商品仓库查询
       /// 2.2
       /// 加载数据字典数组
       ///
       /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
       /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
       /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
       
       func issue_warehouse_query(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
              
           if session_id == nil {
               print("请登陆")
               return
           }
           
           // 1.获取请求的URLString
              let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
              
              // 2.获取请求的参数
           let parameters = ["method" : "phone", "xmlname" : "issue_warehouse_query","model":"直供提货手机端","data": code ] as [String : Any]
              
              // 3.发送网络请求
           request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
               finished(result as? [String : AnyObject], error as NSError?)
              }
          }
    
    
    
    
    /// 发送验证码请求
    /// 2.3
    /// 加载数据字典数组
    ///
    /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
    /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
    /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
    
    func issue_verifycode_apply(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
           
        if session_id == nil {
            print("请登陆")
            return
        }
        
        // 1.获取请求的URLString
           let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
           
           // 2.获取请求的参数
        let parameters = ["method" : "phone", "xmlname" : "issue_verifycode_apply","model":"直供提货手机端","data": code ] as [String : Any]
           
           // 3.发送网络请求
        request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
            finished(result as? [String : AnyObject], error as NSError?)
           }
       }
    
    
    
    /// 交收资金查询
    /// 2.4
    /// 加载数据字典数组
    ///
    /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
    /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
    /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
    
    func issue_delivery_fund_apply(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
           
        if session_id == nil {
            print("请登陆")
            return
        }
        
        // 1.获取请求的URLString
           let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
           
           // 2.获取请求的参数
        let parameters = ["method" : "phone", "xmlname" : "issue_delivery_fund_apply","model":"直供提货手机端","data": code ] as [String : Any]
           
           // 3.发送网络请求
        request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
            finished(result as? [String : AnyObject], error as NSError?)
           }
       }
    
    
    
    /// 交收申请
    /// 2.5
    /// 加载数据字典数组
    ///
    /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
    /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
    /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
    
    func issue_delivery_apply(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
           
        if session_id == nil {
            print("请登陆")
            return
        }
        
        // 1.获取请求的URLString
           let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
           
           // 2.获取请求的参数
        let parameters = ["method" : "phone", "xmlname" : "issue_delivery_apply","model":"直供提货手机端","data": code ] as [String : Any]
           
           // 3.发送网络请求
        request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
            finished(result as? [String : AnyObject], error as NSError?)
           }
       }
    
    
    
    /// 交收申请查询
    /// 2.6
    /// 加载数据字典数组
    ///
    /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
    /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
    /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
    
    func issue_delivery_query(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
           
        if session_id == nil {
            print("请登陆")
            return
        }
        
        // 1.获取请求的URLString
           let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
           
           // 2.获取请求的参数
        let parameters = ["method" : "phone", "xmlname" : "issue_delivery_query","model":"直供提货手机端","data": code ] as [String : Any]
           
           // 3.发送网络请求
        request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
            finished(result as? [String : AnyObject], error as NSError?)
           }
       }
    
    
    
    /// 交收确认
    /// 2.7
    /// 加载数据字典数组
    ///
    /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
    /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
    /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
    
    func issue_delivery_sure(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
           
        if session_id == nil {
            print("请登陆")
            return
        }
        
        // 1.获取请求的URLString
           let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
           
           // 2.获取请求的参数
        let parameters = ["method" : "phone", "xmlname" : "issue_delivery_sure","model":"直供提货手机端","data": code ] as [String : Any]
           
           // 3.发送网络请求
        request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
            finished(result as? [String : AnyObject], error as NSError?)
           }
       }
    
    
    
    /// 交收撤销
    /// 2.8
    /// 加载数据字典数组
    ///
    /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
    /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
    /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
    
    func issue_delivery_revoke(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
           
        if session_id == nil {
            print("请登陆")
            return
        }
        
        // 1.获取请求的URLString
           let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
           
           // 2.获取请求的参数
        let parameters = ["method" : "phone", "xmlname" : "issue_delivery_revoke","model":"直供提货手机端","data": code ] as [String : Any]
           
           // 3.发送网络请求
        request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
            finished(result as? [String : AnyObject], error as NSError?)
           }
       }
    
    
    
    
    /// 获取选号区间
       /// 2.9
       /// 加载数据字典数组
       ///
       /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
       /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
       /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
       
       func issueget_interval_num(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
              
           if session_id == nil {
               print("请登陆")
               return
           }
           
           // 1.获取请求的URLString
              let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
              
              // 2.获取请求的参数
           let parameters = ["method" : "phone", "xmlname" : "issueget_interval_num","model":"直供提货手机端","data": code ] as [String : Any]
              
              // 3.发送网络请求
           request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
               finished(result as? [String : AnyObject], error as NSError?)
              }
          }
    
    
    
    /// 获取区间所有可用选号
    /// 2.10
    /// 加载数据字典数组
    ///
    /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
    /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
    /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
    
    func issueget_labelled(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
           
        if session_id == nil {
            print("请登陆")
            return
        }
        
        // 1.获取请求的URLString
           let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
           
           // 2.获取请求的参数
        let parameters = ["method" : "phone", "xmlname" : "issueget_labelled","model":"直供提货手机端","data": code ] as [String : Any]
           
           // 3.发送网络请求
        request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
            finished(result as? [String : AnyObject], error as NSError?)
           }
       }
    
    
    
    /// 提交选号
    /// 2.11
    /// 加载数据字典数组
    ///
    /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
    /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
    /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
    
    func submit_num(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
           
        if session_id == nil {
            print("请登陆")
            return
        }
        
        // 1.获取请求的URLString
           let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
           
           // 2.获取请求的参数
        let parameters = ["method" : "phone", "xmlname" : "submit_num","model":"直供提货手机端","data": code ] as [String : Any]
           
           // 3.发送网络请求
        request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
            finished(result as? [String : AnyObject], error as NSError?)
           }
       }
    
    
    
    /// 可过户申请
    /// 2.12
    /// 加载数据字典数组
    ///
    /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
    /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
    /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
    
    func issue_enable_transfer_query(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
           
        if session_id == nil {
            print("请登陆")
            return
        }
        
        // 1.获取请求的URLString
           let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
           
           // 2.获取请求的参数
        let parameters = ["method" : "phone", "xmlname" : "issue_enable_transfer_query","model":"直供提货手机端","data": code ] as [String : Any]
           
           // 3.发送网络请求
        request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
            finished(result as? [String : AnyObject], error as NSError?)
           }
       }
    
    
    
    /// 过户资金查询
    /// 2.13
    /// 加载数据字典数组
    ///
    /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
    /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
    /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
    
    func issue_transfer_fund_apply(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
           
        if session_id == nil {
            print("请登陆")
            return
        }
        
        // 1.获取请求的URLString
           let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
           
           // 2.获取请求的参数
        let parameters = ["method" : "phone", "xmlname" : "issue_transfer_fund_apply","model":"直供提货手机端","data": code ] as [String : Any]
           
           // 3.发送网络请求
        request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
            finished(result as? [String : AnyObject], error as NSError?)
           }
       }
    
    
    
    
    /// 过户申请
       /// 2.14
       /// 加载数据字典数组
       ///
       /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
       /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
       /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
       
       func issue_transfer_apply(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
              
           if session_id == nil {
               print("请登陆")
               return
           }
           
           // 1.获取请求的URLString
              let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
              
              // 2.获取请求的参数
           let parameters = ["method" : "phone", "xmlname" : "issue_transfer_apply","model":"直供提货手机端","data": code ] as [String : Any]
              
              // 3.发送网络请求
           request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
               finished(result as? [String : AnyObject], error as NSError?)
              }
          }
    
    
    
    
    /// 过户查询
    /// 2.15
    /// 加载数据字典数组
    ///
    /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
    /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
    /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
    
    func issue_transfer_query(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
           
        if session_id == nil {
            print("请登陆")
            return
        }
        
        // 1.获取请求的URLString
           let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
           
           // 2.获取请求的参数
        let parameters = ["method" : "phone", "xmlname" : "issue_transfer_query","model":"直供提货手机端","data": code ] as [String : Any]
           
           // 3.发送网络请求
        request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
            finished(result as? [String : AnyObject], error as NSError?)
           }
       }
    
    
    
    /// 过户确认
       /// 2.16
       /// 加载数据字典数组
       ///
       /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
       /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
       /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
       
       func issue_transfer_sure(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
              
           if session_id == nil {
               print("请登陆")
               return
           }
           
           // 1.获取请求的URLString
              let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
              
              // 2.获取请求的参数
           let parameters = ["method" : "phone", "xmlname" : "issue_transfer_sure","model":"直供提货手机端","data": code ] as [String : Any]
              
              // 3.发送网络请求
           request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
               finished(result as? [String : AnyObject], error as NSError?)
              }
          }
    
    
    
    
    /// 过户撤销
    /// 2.17
    /// 加载数据字典数组
    ///
    /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
    /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
    /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
    
    func issue_transfer_revoke(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
           
        if session_id == nil {
            print("请登陆")
            return
        }
        
        // 1.获取请求的URLString
           let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
           
           // 2.获取请求的参数
        let parameters = ["method" : "phone", "xmlname" : "issue_transfer_revoke","model":"直供提货手机端","data": code ] as [String : Any]
           
           // 3.发送网络请求
        request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
            finished(result as? [String : AnyObject], error as NSError?)
           }
       }
    
    
    
    
    /// 获取交收所选号
       /// 2.18
       /// 加载数据字典数组
       ///
       /// - parameter since_id:   返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0
       /// - parameter max_id:     返回ID小于或等于max_id的微博，默认为0
       /// - parameter completion: 完成回调[list: 微博字典数组/是否成功]
       
       func issueget_selectnum(session_id : String?, code : Array<Any>, finished : @escaping(_ result : [String : AnyObject]?, _ error : NSError?) -> ()) {
              
           if session_id == nil {
               print("请登陆")
               return
           }
           
           // 1.获取请求的URLString
              let urlString = "http://39.98.72.212:8006/index.php/Admin/Inter/index"
              
              // 2.获取请求的参数
           let parameters = ["method" : "phone", "xmlname" : "issueget_selectnum","model":"直供提货手机端","data": code ] as [String : Any]
              
              // 3.发送网络请求
           request(methodType: .GET, URLString: urlString, parameters: parameters) { (result, error) -> () in
               finished(result as? [String : AnyObject], error as NSError?)
              }
          }
}
